/*
*Author:Jackong
*Date:2012/07/04
*Description: recv_buf of the connnection(decouple from connection)
*/
#pragma once
#include "base_buf.h"

namespace fly {

	namespace jld{

		namespace buffer {	
			class recv_buf
				:public base_buf
			{
			private:
				size_t body_size_;
				PID pid_;
			public:

				//default the header size and  body size
				recv_buf();

				virtual ~recv_buf();

				PID& pid();

				//handle and encode the header protocol
				bool handle_header();

				//get body size
				const size_t& body_size();
			
				//parse body
				bool parse_from_recv(google::protobuf::Message& message_);

			};

		}
	}
}